# from elasticsearch import Elasticsearch
from flask_pymongo import PyMongo
from flask_redis import FlaskRedis
from mongoengine import connect, disconnect

#
# ES = [acm_config["ELASTICSEARCH_URL"]]
# es = Elasticsearch(ES)
mongo = PyMongo()
redis_client = FlaskRedis()


BASE_DB = 'default'
SPIDER_DB = 'invest_data'


def mongo_init(app):
    disconnect()
    connect(BASE_DB, alias=BASE_DB, host=app.config["MONGO_URI"])
    # connect(SPIDER_DB, alias=SPIDER_DB, host=app.config['SPIDER_DB'])
